<%@page import="org.jcms.model.Book"%>
<%@page import="org.jcms.service.BookServiceI"%>
<%@page
	import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<%
	String ISBN = request.getParameter("ISBN");
	if (ISBN == null) {
		out.print("参数错误");
		return;
	}
	ApplicationContext ac = WebApplicationContextUtils
			.getRequiredWebApplicationContext(this.getServletContext());

	BookServiceI bookServiceI = (BookServiceI) ac
			.getBean("bookServiceImpl");

	Book book = bookServiceI.findById(ISBN);

	if (book == null) {
		out.print("此书不存在");
		return;
	}

	java.text.NumberFormat nf = java.text.NumberFormat.getInstance();
	nf.setGroupingUsed(false);
%>
<script type="text/javascript">
	function mySubmit() {
		if ($('#submitForm22').form('validate') != true) {
			return;
		}
		AjaxFormSubmit("../ManagerModifyBookInfomation.do",

		"ajaxImg",

		"submitForm22",

		function(msg) {

			showAlert("操作成功", msg);
			$('#win').window('close');
			$("#list_data").datagrid('reload');

		},

		function(msg) {
			showAlert("操作失败", msg);
		}

		);
	}
</script>
</head>
<form id="submitForm22" onsubmit="mySubmit();return false;">
	<div style="text-align: center;">

		<table>
			<tr>
				<td>*ISBN:</td>
				<td><%=ISBN%><input type="hidden" name="ISBN" value="<%=ISBN%>" />
				</td>
			</tr>

			<tr>
				<td>*书名:</td>
				<td><input type="text" maxlength="200"
					class="easyui-validatebox" id="bookName" name="bookName"
					data-options="required:true,missingMessage:'不能为空'"
					value="<%=book.getBookName()%>" /></td>
			</tr>



			<tr>
				<td>出版社:</td>
				<td><input type="text" maxlength="200" id="bookPublisher"
					name="bookPublisher" value="<%=book.getBookPublisher()%>" /></td>
			</tr>

			<tr>
				<td>作者:</td>
				<td><input type="text" maxlength="100" id="bookAuthor"
					name="bookAuthor" value="<%=book.getBookAuthor()%>" /></td>
			</tr>

			<tr>
				<td>*价格:</td>
				<td><input type="text" maxlength="100" id="bookPrice"
					name="bookPrice" class="easyui-validatebox"
					data-options="required:true,missingMessage:'不能为空'"
					value="<%=nf.format(book.getBookPrice())%>" /></td>
			</tr>

			<tr>
				<td colspan="2" style="text-align: center;"><input
					type="submit" value="提交" />
				</td>

			</tr>

		</table>

		<img src="../../images/loading.gif"
			style="display: none; height: 25px; width: 25px;" id="ajaxImg" />
	</div>
</form>
</body>
</html>



